package com.wx.chapter19.writer_;

import java.io.*;
import java.util.ArrayList;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/8/30 - 12:06
 */
public class BufferedCopy_ {
    public static void main(String[] args) throws IOException {
        String src = "e:\\story.txt";
        String dest = "e:\\story2.txt";
        BufferedReader br = null;
        BufferedWriter bw = null;
        String line;
        br = new BufferedReader(new FileReader(src));
        bw = new BufferedWriter(new FileWriter(dest));
        while ((line = br.readLine()) != null) {
            bw.write(line);
            bw.newLine();//换行
        }
        if (br != null) {
            br.close();
        }
        if (bw != null) {
            bw.close();
        }
    }
}
